resource "google_container_cluster" "primary" {
  name               = "<%= ctx[:vars]['cluster_name'] %>"
  location           = "us-central1-a"
  initial_node_count = 1
}

resource "google_gke_hub_membership" "membership" {
  membership_id = "<%= ctx[:vars]['name'] %>"
  endpoint {
    gke_cluster {
      resource_link = "//container.googleapis.com/${google_container_cluster.primary.id}"
    }
  }
}
